package com.foreknow.oop9;

public class ExceptionDemo {
  public static void main(String[] args) {



    try {
      //要将有可能出现错误的代码放到try
      int[] array = {1,2,3,4,5,6};
      for(int i = 0;i<=array.length;i++){
        System.out.println(array[i]);
      }
    }catch(ArrayIndexOutOfBoundsException e) {
      System.out.println("数组下标越界异常......");
    }

    System.out.println("1111111111111");
  }
}
